import 'package:json_annotation/json_annotation.dart';
@JsonSerializable()
class LoginBean {
  User user;
  String token;

  LoginBean({this.user, this.token});

  LoginBean.fromJson(Map<String, dynamic> json) {
    user = json['user'] != null ? new User.fromJson(json['user']) : null;
    token = json['token'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.user != null) {
      data['user'] = this.user.toJson();
    }
    data['token'] = this.token;
    return data;
  }
}

class User {
  int id;
  Null name;
  Null password;
  Null sex;
  String phone;
  Null loginType;
  String code;
  String createTime;
  Null updateTime;
  String delFlag;
  String phoneToken;

  User(
      {this.id,
        this.name,
        this.password,
        this.sex,
        this.phone,
        this.loginType,
        this.code,
        this.createTime,
        this.updateTime,
        this.delFlag,
        this.phoneToken});

  User.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    password = json['password'];
    sex = json['sex'];
    phone = json['phone'];
    loginType = json['loginType'];
    code = json['code'];
    createTime = json['createTime'];
    updateTime = json['updateTime'];
    delFlag = json['delFlag'];
    phoneToken = json['phoneToken'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['password'] = this.password;
    data['sex'] = this.sex;
    data['phone'] = this.phone;
    data['loginType'] = this.loginType;
    data['code'] = this.code;
    data['createTime'] = this.createTime;
    data['updateTime'] = this.updateTime;
    data['delFlag'] = this.delFlag;
    data['phoneToken'] = this.phoneToken;
    return data;
  }
}